import request from '@/config/axios'

export interface PayBillVO {
  id: number
  userId: number
  relateId: string
  mode: number
  title: string
  category: string
  type: string
  number: number
  balance: number
  mark: string
  status: boolean
}

// 查询用户账单列表
export const getPayBillPage = async (params: any) => {
  return await request.get({ url: `/pay/bill/page`, params })
}

// 查询用户账单详情
export const getPayBill = async (id: number | string) => {
  return await request.get({ url: `/pay/bill/get?id=` + id })
}

// 新增用户账单
export const createPayBill = async (data: PayBillVO) => {
  return await request.post({ url: `/pay/bill/create`, data })
}

// 修改用户账单
export const updatePayBill = async (data: PayBillVO) => {
  return await request.put({ url: `/pay/bill/update`, data })
}

// 删除用户账单
export const deletePayBill = async (id: number | string) => {
  return await request.delete({ url: `/pay/bill/delete?id=` + id })
}

// 导出用户账单 Excel
export const exportPayBill = async (params: any) => {
  return await request.download({ url: `/pay/bill/export-excel`, params })
}
